package com.myjob.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 使用 SHA-256 +随机盐+密钥 的加密算法
 */
public class BPwdEncoderUtil {

	private static final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder ();


	public static String BCryptPassword(String password){
		return encoder.encode(password);
	}

	public static boolean matches (CharSequence rawPassword, String encodedPassword) {
		return encoder.matches(rawPassword, encodedPassword);
	}


}
